﻿using System.IO;
using System.Web;

namespace System.Reflection
{
	internal static class AssemblyExtensions
	{
		internal static string GetBasePath(this Assembly assembly)
		{
			string basePath = Path.GetDirectoryName(assembly.CodeBase);
			Uri basePathUri = new Uri(basePath);
			basePath = HttpUtility.UrlDecode(Path.GetFullPath(basePathUri.LocalPath));

			return (basePath + @"\" + assembly.ManifestModule.Name);
		}
	}
}